# Maintainer: Peter Budai <peterbudai@hotmail.com>

_realname=sphinxcontrib-moderncmakedomain
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=3.17
pkgrel=1
pkgdesc="Sphinx Domain for Modern CMake (mingw-w64)"
arch=('any')
license=('CMake')
url="https://github.com/slurps-mad-rips/moderncmakedomain"
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest")
source=("${_realname}-${pkgver}.tar.gz"::"https://pypi.org/packages/source/s/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('7193add5a9e61945f688d45335848f18a18931d5e19068cf6834a576301a46d7')

prepare() {
  cd ${srcdir}
  cp -r ${_realname}-${pkgver} python-build-${CARCH}
}

build() {
  cd "${srcdir}/python-build-${CARCH}"
  ${MINGW_PREFIX}/bin/python setup.py build
}

check() {
  cd "${srcdir}/python-build-${CARCH}"
  ${MINGW_PREFIX}/bin/py.test || warning "test failed"
}

package() {
  cd "${srcdir}/python-build-${CARCH}"
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py install -O1 --skip-build \
      --root="${pkgdir}" --prefix=${MINGW_PREFIX}
}
